package com.fqcar.fqdf.entity;

import android.os.Parcel;
import android.os.Parcelable;

import com.fqdf.framework.android.net.response.BaseRespBean;

/**
 * Created by lvsidong on 17/10/19.
 *
 * 首页车辆信息
 */
public class CarInfo extends BaseRespBean implements Parcelable{

    public int carId;
    public Double lat;
    public Double lng;
    public int status;
    public int power;
    public boolean isSelect;
    public int chargeStatus;

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public int getChargeStatus() {
        return chargeStatus;
    }

    public void setChargeStatus(int chargeStatus) {
        this.chargeStatus = chargeStatus;
    }

    public static Creator<CarInfo> getCREATOR() {
        return CREATOR;
    }

    public int getPower() {
        return power;
    }

    public void setPower(int power) {
        this.power = power;
    }


    public CarInfo() {
    }
    public boolean isSelect() {
        return isSelect;
    }

    public void setSelect(boolean select) {
        isSelect = select;
    }

    public int getState() {
        return status;
    }

    public void setState(int state) {
        this.status = state;
    }

    public int getCarId() {
        return carId;
    }

    public void setCarId(int carId) {
        this.carId = carId;
    }

    public Double getLat() {
        return lat;
    }

    public void setLat(Double lat) {
        this.lat = lat;
    }

    public Double getLng() {
        return lng;
    }

    public void setLng(Double lng) {
        this.lng = lng;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.carId);
        dest.writeValue(this.lat);
        dest.writeValue(this.lng);
        dest.writeInt(this.status);
        dest.writeInt(this.power);
        dest.writeByte(this.isSelect ? (byte) 1 : (byte) 0);
        dest.writeInt(this.chargeStatus);
    }

    protected CarInfo(Parcel in) {
        this.carId = in.readInt();
        this.lat = (Double) in.readValue(Double.class.getClassLoader());
        this.lng = (Double) in.readValue(Double.class.getClassLoader());
        this.status = in.readInt();
        this.power = in.readInt();
        this.isSelect = in.readByte() != 0;
        this.chargeStatus = in.readInt();
    }

    public static final Creator<CarInfo> CREATOR = new Creator<CarInfo>() {
        @Override
        public CarInfo createFromParcel(Parcel source) {
            return new CarInfo(source);
        }

        @Override
        public CarInfo[] newArray(int size) {
            return new CarInfo[size];
        }
    };
}
